﻿<Selection:jSLGrid x:Class="jSLApp.Client.Controls.MusicGrid"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                          HeadersVisibility="Column"
                          xmlns:Selection="clr-namespace:jSLCore.Client.Presentation.BaseControl.Selection;assembly=jSLCore.Client.Presentation" xmlns:tk="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data" xmlns:jBinding="clr-namespace:jSLCore.Client.Presentation.jBinding;assembly=jSLCore.Client.Presentation" xmlns:Controls="clr-namespace:jSLCore.Client.Presentation.Controls;assembly=jSLCore.Client.Presentation" xmlns:BaseConverters="clr-namespace:jSLCore.Client.Presentation.jBinding.BaseConverters;assembly=jSLCore.Client.Presentation"
                          ShowDetailsClicked="goto_Details">
    <Selection:jSLGrid.Resources>
        <ResourceDictionary Source="../Resources/UndergroundStyle.xaml"/>
    </Selection:jSLGrid.Resources>
    <Selection:jSLGrid.Columns>        
        <Selection:DataGridImageButtonColumn ButtonImage="../Resources/PlayMini.png" Click="Play_Song"/>
        <tk:DataGridTextColumn Header="Автор" Binding="{Binding AuthorName}"/>
        <Selection:DataGridGoDetailsColumn Header="Название" Binding="{Binding Name}"  Width="270"/>
        <tk:DataGridTextColumn Header="Длина">
            <tk:DataGridTextColumn.Binding>
                <jBinding:jBinding Path="Length" ConvertingMode="SecondsToTimeSpanString" />
            </tk:DataGridTextColumn.Binding>
        </tk:DataGridTextColumn>
        <tk:DataGridTemplateColumn>
            <tk:DataGridTemplateColumn.CellTemplate>
                <DataTemplate>
                    <HyperlinkButton Content="Скачать" Click="download_Clicked">
                        <HyperlinkButton.Visibility>
                            <jBinding:jBinding Path="AllowDownload">
                                <jBinding:jBinding.Converter>
                                    <BaseConverters:jBoolToVisibilityConverter/>
                                </jBinding:jBinding.Converter>
                            </jBinding:jBinding>
                        </HyperlinkButton.Visibility>
                    </HyperlinkButton>
                </DataTemplate>
            </tk:DataGridTemplateColumn.CellTemplate>
        </tk:DataGridTemplateColumn>
    </Selection:jSLGrid.Columns>
</Selection:jSLGrid>
